package main;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

import java.io.File;
import java.net.MalformedURLException;


import gate.Gate;
import gate.util.GateException;

import org.apache.james.mime4j.dom.datetime.DateTime;
import org.hibernate.*;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.service.ServiceRegistryBuilder;

import domain.DcmiRecord;

public class Main {

	/**
	 * @param args
	 * @throws GateException
	 * @throws MalformedURLException 
	 * @throws ParseException 
	 */

	@SuppressWarnings("deprecation")
	public static void main(String[] args) throws GateException, MalformedURLException, ParseException {
		// TODO Auto-generated method stub
		/*System.out.println("Ciao");
		Configuration configuration = new Configuration();
		configuration.configure();
		ServiceRegistry serviceRegistry= new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry();
		SessionFactory sf = configuration.buildSessionFactory(serviceRegistry);
		System.out.println("Finito di caricare configurazione");
		Session session = sf.openSession();
		System.out.println("Sessione aperta");
		Transaction tx = session.beginTransaction();
		List<DcmiRecord> records = session.createQuery("select r from DcmiRecord r where id='26994'").list();
		for (DcmiRecord r:records){
			System.out.println(r.getDataEstrazione());
		}
		tx.commit();
		session.close();
		*/
//		DateFormat dateFormat = new SimpleDateFormat("yyyy-dd-mm hh:mm:ss");
//		
// 	   java.util.Date date = dateFormat.parse("2009-12-12 21:22:15");
// 	   
// 	   java.util.Date adesso= new java.util.Date();
// 	   long time = adesso.getTime();
// 	   new java.sql.Timestamp(time);
// 	   
// 	   System.out.println(new java.sql.Timestamp(time));
// 	   
 	  java.util.Date datautil = new java.util.Date();
 	 
 	  
 	  System.out.println("data completa: "+ datautil);
 	  Long millis= datautil.getTime();
 	  System.out.println("data completa millisecondi long: "+ millis);
 	 java.util.Date datariconverted= new java.util.Date(millis);
 	 System.out.println("data ritradotta: "+ datariconverted);
 	 System.out.println("data massima: "+ new java.util.Date(0)); 
 	 System.out.println("value min_Value"+ Long.MIN_VALUE);
 	  
 	  
 	  
	}

}
